Subject: Direct Blitting in C++ Author: Macneil Shonle Uploaded By: MacneilS Date: 7/2/1995 File: Blitting.sit (12750 bytes) Estimated Download Time (60658 baud): < 1 minute Download Count: 401 Needs: C++ compiler Keywords: GWORLD OFFSCREEN DRAWING PIXMAP GRAPHICS QUICKDRAW LIBRARY: MDV/Developer Source Code/C++ KEYWORDS: GWORLD OFFSCREEN DRAWING PIXMAP GRAPHICS QUICKDRAW The Direct Blitting Class Library for the MacOS No matter what you are doing, the direct approach is almost always the best approach. As it turns out, animation is not an exception to this rule. Unfortunately, the direct approach is not always the easiest. The following classes will help you to make direct blitting easier, faster, and more compatible for you. The classes depend highly on C++ and the Macintosh toolbox, so some knowledge of both are necessary. The direct blitting classes are derived from one base: CDirectBlit. CDirectBlit's sub-classes are currently CDirectGWorld and CDirectVideo. The CDirectBlit class is responsible for accessing blitting information and toolbox information, while its sub-classes are responsible for setting up where the memory will be used. The CDirectGWorld class makes use of QuickDraw's offscreen GWorlds, and the CDirectVideo class makes use of onscreen CGrafPorts and device PixMaps. There is also a CCopier class, which helps you copy from one CDirectBlit to the next. Stack based GWorld setters and MMU mode swappers are also provided, modeled after classes like StHandleLocker. Setting up a GWorld and an onscreen blitting area is easy to do. Here, for example, is how one would allocate memory for a GWorld that is ready to be directly accessed: CDirectGWorld offscreen( bounds, kEightBit ); where bounds is a QuickDraw rectangle describ